import java.util.Scanner;

public class 递归实现指数型枚举 {
    private static int N = 15;
    private static int s[] = new int[N];
    private static int n;

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        n = scan.nextInt();
        dfs(0);
    }

    private static void dfs(int u) {
        if (u == n) {
            for (int i = 0; i < n; i++) {
                if (s[i] == 1)
                    System.out.print(i + 1 + " ");
            }
            System.out.println();
            return;
        }
        s[u] = 2;
        dfs(u + 1);
        s[u] = 0;
        s[u] = 1;
        dfs(u + 1);
        s[u] = 0;
    }
}
